package com.xiaoxing.salesclient.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.xiaoxing.salesclient.mvp.contract.AppointTimeContract;
import com.xiaoxing.salesclient.mvp.model.entity.AppointSet;
import com.xiaoxing.salesclient.mvp.model.entity.AppointTime;
import com.xiaoxing.salesclient.mvp.model.service.SalesService;

import javax.inject.Inject;

import io.reactivex.Observable;


@ActivityScope
public class AppointTimeModel extends BaseModel implements AppointTimeContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public AppointTimeModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<AppointTime> checkDetail(String access_token, String doctor_id, String date, String shop_id) {
        return mRepositoryManager.obtainRetrofitService(SalesService.class).checkDetail(access_token, doctor_id, date, shop_id);
    }

    @Override
    public Observable<AppointSet> appointSet(String date, String time_id, String access_token, String doctor_id, String uid) {
        return mRepositoryManager.obtainRetrofitService(SalesService.class).appointSet(date, time_id, access_token, doctor_id, uid);
    }
}